Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to dotnet 7 and enabling code analysis #171

Merged
merged 4 commits into from
Sep 15, 2023
Merged

Conversation

jochenjonc
Copy link
Contributor

I took the liberty to update SynoAI from .Net 5 to .Net 7 and also applied some fixes suggested by the dotnet compiler after enabling code analysis.

  • Update csproj, docker and github actions to use dotnet 7
  • Updated all referenced NuGet packages to their latest version
  • Enabled TreatWarningsAsErrors during the build
  • Enabled code analysis during the build by adding AnalysisLevel 6.0-recommended to the csproj file and fixed most of the warnings/errors they produced
  • Excluded some errors from the build (some of which need to be fixed, like the one about logging)
  • Made a lot of classes internal, this way the XML docs are not required for them
  • Enabled the usage of a package.lock.json file
  • Enabled ImplicitUsings and removed a lot of using from the classes

I hope this helps in the performance and stability of SynoAI. .NET 7 should be faster and have a lower memory footprint than .NET 5. If you approve this and like my changes, I will invest some more time in code optimizations. First by getting rid of all the warnings and then see if there are other places where the code could be improved.

@sanderdewit
Copy link
Contributor

did you do some benchmark on the performance?

@jochenjonc
Copy link
Contributor Author

@sanderdewit I did not do any performance benchmarks myself, but MS created a very big blog article containing all the performance improvements they applied in .NET 7.

https://devblogs.microsoft.com/dotnet/performance_improvements_in_net_7/

Also, .NET 5 is no longer supported by MS. See https://devblogs.microsoft.com/dotnet/dotnet-5-end-of-support-update/

@djdd87 djdd87 merged commit 5e9d555 into djdd87:main Sep 15, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants